<!DOCTYPE html>
<!--
  ~ Copyright (C) 2018 guomw.Inc. All rights reserved.
  ~ 项目名称： mysite
  ~ 文件名称： index.html
  ~ Date：18-9-6 下午3:06
  ~ Author: guomw
  -->

<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/head::head('登录-基因报告管理后台')"></head>
<body class="gray-bg">
<div class="middle-box text-center loginscreen  animated fadeInDown" style="padding-top: 15%;">
    <div>
        <h3>欢迎使用基因报告管理后台</h3>
        <form class="m-t" role="form" th:action="@{/doLogin}" method="post">
            <div class="form-group">
                <input name="loginName" id="loginName" type="text" class="form-control" placeholder="用户名" value="root">
            </div>
            <div class="form-group">
                <input name="loginPwd" id="loginPwd" type="password" class="form-control" placeholder="密码" value="root@1234">
            </div>
            <div class="form-group" style="height: 35px;line-height: 35px;">
                <input name="verifyCode" id="verifyCode" type="text"
                       style="width: 200px;display: inline-block;float: left;" class="form-control" placeholder="验证码">
                <img id="code" src="/verifyCode" style="float: right;height: 34px;width: 100px;"
                     onclick="refreshVerifyCode(this)"/>
            </div>

            <button type="submit" class="btn btn-primary block full-width m-b">登 录</button>
            <div class="form-group" id="error">
                <span class="text-danger"></span>
            </div>
        </form>
    </div>
</div>
<script src="../resource/js/jquery.min.js?v=2.1.4"></script>
<script src="../resource/js/bootstrap.min.js?v=3.3.5"></script>
<script src="../resource/js/plugins/hot/Jquery.util.js"></script>
<script th:inline="javascript">
    var error = hotUtil.getQuery("error");
    switch (error) {
        case "1":
            $(".text-danger").text('用户不存在');
            break;
        case "2":
            $(".text-danger").text('验证码错误');
            break;
        case "3":
            $(".text-danger").text('密码不正确');
            break;
        case "4":
            $(".text-danger").text('账户已被禁用，请联系管理员！');
            break
        default:
            $(".text-danger").text('');
            break
    }

    function refreshVerifyCode() {
        $("#code").attr("src", "/verifyCode?r=" + Math.random());
    }
</script>
</body>
</html>